package main

import (
	"fmt"
	"time"
)

type myTime struct{ time.Time }

func (t *myTime) first3Charts() string {
	return t.String()[0:3]
}

// type aTime time.Time 不能继承time.Time的方法

// func (t *aTime) String() string {
// 	t.Format()
// }

func main() {
	t := myTime{time.Now()}
	fmt.Println("time now: ", t.String())         // 2022-12-30 13:32:00.916081375 +0800 CST m=+0.000036886
	fmt.Println("time short: ", t.first3Charts()) // 202
}
